package com.junzhiit.nengji.shop.model.enums;

import com.bainaeco.framework.exception.InvalidArgumentException;

public enum ConfirmType {
	
	SYSTEM(0,"系统默认"),
	USER(1,"用户确认"),
	SHOP(2,"商户确认"),
	PLATFORM(3,"总部确认");
	
	
	private Integer value;
	private String text;

	private ConfirmType(Integer value,String text) {
		this.value = value;
		this.text = text;
	}

	public Integer toIntValue() {
		return this.value;
	}
	
	public String toStringText() {
		return this.text;
	}

	public static ConfirmType toStatus(Integer value) {
		if (SYSTEM.value == value) {
			return SYSTEM;
		} else if (USER.value == value) {
			return USER;
		} else if (SHOP.value == value) {
			return SHOP;
		} else if (PLATFORM.value == value) {
			return PLATFORM;
		}else {
			throw new InvalidArgumentException("Unknown ConfirmType[" + value + "].");
		}
	}
}
